package com.zxy.zxyrpc.springboot.starter.annotation;

import com.zxy.zxyrpc.springboot.starter.bootstrap.RpcConsumerBootStrap;
import com.zxy.zxyrpc.springboot.starter.bootstrap.RpcInitBootStrap;
import com.zxy.zxyrpc.springboot.starter.bootstrap.RpcProviderBootStrap;
import org.springframework.context.annotation.Import;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 启用 RPC 注解
 *
 * @author zxy
 * @since 2025/5/30
 **/
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
// 条件加载
@Import({RpcInitBootStrap.class, RpcProviderBootStrap.class, RpcConsumerBootStrap.class})
public @interface EnableRpc {
    /**
     * 需要启动 server
     */
    boolean needServer() default true;
}
